package com.hulizuofang.wol.chat.client.action;

import java.io.Serializable;
import java.util.Set;

import com.gwtplatform.dispatch.shared.Result;
import com.hulizuofang.wol.chat.client.data.ChatUser;

public class LoginResult implements Result, Serializable {
	private static final long serialVersionUID = 1L;
	private ChatUser user;
	private Set<ChatUser> onlineUser;
	private String token;

	LoginResult() {/* GWT only */}
	
	public LoginResult(ChatUser user, String token, Set<ChatUser> onlineUser) {
		this.user = user;
		this.token = token;
		this.onlineUser = onlineUser;
	}

	public void workResult(LoginResultWorker setLoginResultWorker) {
		setLoginResultWorker.work(user, token, onlineUser);
	}
	
	public interface LoginResultWorker {
		void work(ChatUser user, String token, Set<ChatUser> onlineUser);
	}
}
